<!DOCTYPE html>


<html>
	<head>
		<meta charset="utf-8">
		<title></title>

        <link href="/css/bootstrap.css" rel="stylesheet" type="text/css" />
        <script src="/js/jquery-1.11.0.min.js" type="text/javascript"></script>
	</head>
	<body>
	<br>
	<br>
	<center>
	<h2>登陆页面</h2></center>
<form class="form-horizontal" id="fm">
  <div class="form-group">
    <label  class="col-sm-2 control-label">账号：</label>
    <div class="col-sm-10">
      <input type="text" class="form-control" id="input" name="username" placeholder="account">
    </div>
  </div>
  <div class="form-group">
    <label for="inputPassword3" class="col-sm-2 control-label">密码：</label>
    <div class="col-sm-10">
      <input type="password" class="form-control" id="inputPassword3" name="password" placeholder="Password">
    </div>
  </div>
 
  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-10">
      <input type="button" class="btn btn-default" onclick="login()" value="登录">
    </div>
  </div>
</form>
    <script>
        function login(){
            $.ajax({
                url:"/user/login",
                data:$("#fm").serialize(),
                type:"post",
                success:function (data) {
                    alert(data.msg);
                    location.href="/index.html"
                }
            })
        }

    </script>
	</body>
</html>
